package com.zjm.behavioral.observer.demo01;

/**
 * 显示当前天气情况（可以理解为气象站的网站）
 */
public class CurrentConditions {
    private float temperature;
    private float pressure;
    private float humidity;

    /**
     * 更新
     * @param temperature
     * @param pressure
     * @param humidity
     */
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    /**
     * 显示
     */
    public void display() {
        System.out.println("temperature:" + temperature);
        System.out.println("pressure:" + pressure);
        System.out.println("humidity:" + humidity);
    }
}
